Conditions | 2 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Inject } from '@nestjs/common'; |
||
17 | |||
18 | public async execute(command: CreateIngestionCommand): Promise<string> { |
||
19 | const { schoolId } = command; |
||
20 | const school = await this.schoolRepository.findOneById(schoolId); |
||
21 | if (!school) { |
||
22 | throw new SchoolNotFoundException(); |
||
23 | } |
||
24 | |||
25 | const ingestion = await this.ingestionRepository.save( |
||
26 | new Ingestion( |
||
27 | school |
||
28 | ) |
||
29 | ); |
||
30 | |||
31 | return ingestion.getId(); |
||
32 | } |
||
34 |